﻿@model Fcom.VNInsurance.Web.Models.ProductLang
@{
    ViewBag.Title = Model.DisplayName;
    var LangCat = (Fcom.VNInsurance.Web.Models.ProductCatLang)ViewBag.LangCat;
    Layout = "~/Views/Shared/_0311layout.cshtml";
    var productFAQ = (IEnumerable<Fcom.VNInsurance.Web.Models.ProductFAQ>)ViewBag.productFAQ;
    var Userinfo = (Fcom.IDLib.SaveMoneyID.FullUserInfo)ViewBag.FullUserinfo;
    var location=(IEnumerable<Fcom.VNInsurance.Web.Models.LocationLang>)ViewBag.location;
    var traveltype = (IEnumerable<Fcom.VNInsurance.Web.Models.TravelPolicyTypeLang>)ViewBag.traveltype;
    var bene = (IEnumerable<int>)ViewBag.bene;
    var benelang = (IEnumerable<Fcom.VNInsurance.Web.Models.BenefitLang>)ViewBag.benelang;
    var packageproduct = (IEnumerable<Fcom.VNInsurance.Web.Models.PackageProduct>)ViewBag.packageproduct;
    var packagelang=(IEnumerable<Fcom.VNInsurance.Web.Models.PackageLang>)ViewBag.packagelang;
    var packagebenefit = (IEnumerable<Fcom.VNInsurance.Web.Models.PackageBenefit>)ViewBag.packagebenefit;
}
<script type="text/javascript">
    $(document).ready(function () {
        $("#Departure").datepicker({
            dateFormat: "yy-mm-dd",
            changeMonth: true,
            changeYear: true,
            showButtonPanel: true,
            minDate: new Date(),
        });
        $("#Departure").keypress(function (event) { event.preventDefault(); });
        var myDate = new Date();
        var date = myDate.getFullYear() + '-' + ('0' + myDate.getMonth() + 2).slice(-2) + '-' + ('0' + myDate.getDate()).slice(-2);
        $("#Departure").val(date);
        $("#Return").datepicker({
            dateFormat: "yy-mm-dd",
            changeMonth: true,
            changeYear: true,
            showButtonPanel: true,
            minDate: new Date(),
        });
        $("#Return").keypress(function (event) { event.preventDefault(); });
        $("#Return").val(date);
        $("#Days").val(0);
        if ($("#TravelPolicyID").val() == 1)
        {
            $("#NumofPeople").val(1);
            disable_textbox("NumofPeople");
            disable_textbox("Child")
        }
        $("#TravelPolicyID").change(function () {
            if ($("#TravelPolicyID").val() == 2 || $("#TravelPolicyID").val() == 3)
            {
                $("#NumofPeople").val("");
                $("#Child").val("");
                enable_textbox("NumofPeople");
                enable_textbox("Child");
                $("#NumofPeople").keypress(function (event) { return e.find("option:first"); });
            }
            if ($("#TravelPolicyID").val() == 1) {
                $("#NumofPeople").val(1);
                $("#Child").val("");
                disable_textbox("NumofPeople");
                disable_textbox("Child")
            }
        });
        $("#Return").change(function () {
            var depat = new Date($("#Departure").val());
            var returns = new Date($("#Return").val());
            var offset = returns.getTime() - depat.getTime();
            if (offset >= 0) {
                var totalDays = Math.round(offset / 1000 / 60 / 60 / 24);
                $("#Days").val(totalDays)   
            }
        });
        $("#Departure").change(function () {
            var depat = new Date($("#Departure").val());
            var returns = new Date($("#Return").val());
            var offset = returns.getTime() - depat.getTime();
            if (offset >= 0) {
                var totalDays = Math.round(offset / 1000 / 60 / 60 / 24);
                $("#Days").val(totalDays)

            }
        });
    });
    function disable_textbox(tid) {
        var mytextbox = document.getElementById(tid);
        mytextbox.readOnly = true;
    }
    function enable_textbox(tid) {
        var mytextbox = document.getElementById(tid);
        mytextbox.readOnly = false;
    }
</script>
<div class="container">
     <ul class="breadcrumb" style="margin-bottom:0px !important">
                      <li><a href="@Url.Action("Index", "Home")">@Fcom.VNInsurance.Web.LangResource.Layout.lblHome</a></li>
                <li><a href="@Url.Action("Index",LangCat.ProductCat.CatName)">@LangCat.DisplayName</a></li>
                      <li class="active">@Model.DisplayName</li>
      </ul>
            <div style="clear:both"></div>
    <div class="top_slider container" id="afocus">
             <div class="col-lg-7" style="padding-top:10px;font-weight:bold;">
             @Fcom.VNInsurance.Web.LangResource.ContactLayout.lblComapreMaket
             </div>
			<div class="col-lg-4">
                        <ol class="top_bar">
                        <li><a class="active" id="show_div"><span style="font-weight:bold;">@Fcom.VNInsurance.Web.LangResource.ContactLayout.lblinfomation</span></a> </li>
                        <li><a class="bar_2"><span>@Fcom.VNInsurance.Web.LangResource.Layout.lblCompareText</span></a></li>
                        <li><a class="bar_3"><span>@Fcom.VNInsurance.Web.LangResource.Layout.lblPolicy</span></a></li>
                        <li style="width: 70px !important;"><a class="bar_4"><span>@Fcom.VNInsurance.Web.LangResource.Layout.lblPayment</span></a></li>
                    </ol>
            <div style="clear:both"></div>
			</div>
           <div style="clear:both"></div>
        </div>
</div>
<form method="post" id="frmcollect">
<div class="container" style="margin-top:10px;">
    

        <div class="accright">   
        <strong>
            @Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblInsuranceinfo </strong><br />
           
            <ul>

                <li>
                  <span  style="width:140px;display: inline-block;">@Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblDestination</span>
                   <select class="dropdownwid form-control valid" name="LocationID">
                       @foreach (var loca in location)
                       {
                           <option value="@loca.LocationID">@loca.DisplayName</option> 
                       }
                   </select>
                </li>
                 <li>
                     <span style="width:140px;display: inline-block;"> @Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblTravelType</span>
                   <select class="dropdownwid form-control valid" name="TravelPolicyID" id="TravelPolicyID">
                       @foreach (var type in traveltype)
                       {
                           <option value="@type.TravelPolicyID">@type.DisplayName</option> 
                       }
                   </select>
                </li>
                <li>
                   @Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblSchedule   
                </li>
                               
                <li>
                    <span style="width:125px;display: inline-block; padding-left:15px;">@Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblDeparture </span>
                     <input type="text" class="form-control" style="width:125px;padding-left:5px;" name="Departure" id="Departure"/>
                    <span style="width:80px;padding-left:20px;display:inline-block;">@Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblDays </span>
                    <input type="text" class="form-control" style="width:125px;padding-left:5px;" name="Days" id="Days" readonly="readonly" />
                </li>
            
                <li>
                    <span style="width:125px;display: inline-block; padding-left:15px;" >@Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblReturn </span>
                    <input type="text" class="form-control" style="width:125px;padding-left:5px;" name="Return" id="Return"/>
                  
                </li>
                <li>
                  <label  style="width:125px;display: inline-block; padding-left:15px;">@Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblNumofPeople </label>
                    <input type="text" class="form-control" style="width:125px;padding-left:5px;" name="NumofPeople" id="NumofPeople"/>
                </li>
                <li>
                    <label style="width:125px;display: inline-block; padding-left:15px;">@Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblChild </label>
                    <input type="text" class="form-control" style="width:125px;padding-left:5px;" name="Child" id="Child"/>
                </li>

               @if (!User.Identity.IsAuthenticated)
               {
                   
                <li style="width: 305px;float: left;display: block;margin-top: 8px;">
                    @Html.Hidden("isAuth",false)
                    <label for="haveAccount">@Fcom.VNInsurance.Web.LangResource.ContactLayout.lblAreyoumember</label>
                    <label class="nonleft" style="font-weight:normal">
                <input type="radio" name="haveAccount" id="optionsRadios1" value="true" />
                @Fcom.VNInsurance.Web.LangResource.ContactLayout.lblHave
              </label>
                  <label class="nonleft" style="font-weight:normal">
                <input type="radio" name="haveAccount" id="optionsRadios2" value="false" checked/>
                @Fcom.VNInsurance.Web.LangResource.ContactLayout.lblHavent
              </label>
                    <div style="clear:both"></div>
                </li>
                      <li class="userli user">
                                       <label for="haveAccount">@Fcom.VNInsurance.Web.LangResource.ContactLayout.lblyoure</label>
                                 <label class="nonleft2" style="font-weight:normal">
                            <input type="radio" name="accountype" id="accountpesional" value="1" checked/> @Fcom.VNInsurance.Web.LangResource.ContactLayout.lblpersional
               
                          </label>
                              <label style="display:none;" class="nonleft2" style="font-weight:normal">
                            <input type="radio" name="accountype" id="accountbussiness" value="2" disabled="true" style="display:none;"/>@Fcom.VNInsurance.Web.LangResource.ContactLayout.lblcorp
                                  </label>
                           <div style="clear:both"></div>
                       
                     </li>
                     <li class="userli user">
                         <label id="lbfullname" for="yourfullname">@Fcom.VNInsurance.Web.LangResource.Layout.lblFullname</label>
                         <input type="text" class="form-control" style="width:170px" name="yourfullname" id="yourfullname" placeholder="@Fcom.VNInsurance.Web.LangResource.Layout.lblEnterFullname"/>
                     </li>
                      <li class="userli user">
                         <label for="youremail">@Fcom.VNInsurance.Web.LangResource.Layout.lblEmail</label>
                         <input type="text" style="width:170px" class="form-control" name="youremail" id="youremail" placeholder="@Fcom.VNInsurance.Web.LangResource.Layout.lblEnterYourEmail"/>
                        
                     </li>
                      <li class="userli user">
                         <label for="yourphone">@Fcom.VNInsurance.Web.LangResource.Layout.lblYourPhone</label>
                         <input type="text" style="width:170px" class="form-control" name="yourphone" id="yourphone" placeholder="@Fcom.VNInsurance.Web.LangResource.Layout.lblEnterYourPhone"/>
                     </li>
                       <li class="userli user userpersonal">
                    <label for="Model">@Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblGender</label>
                    <label style="font-weight:normal" class="nonleft"><input type="radio" name="gender" value="true" checked="">@Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblBoy</label> <label class="nonleft" style="font-weight:normal"><input type="radio" name="gender" value="true">@Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblGirl</label>
                           <div style="clear:both"></div>
                </li>
                      <li class="userli user userpersonal">
                    <label for="Model">@Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblBirthday</label>
                    <input type="text" name="dateofBirth" class="form-control" id="dateofBirth" placeholder="dd/mm/yyyy"/>
                           <div style="clear:both"></div>
                </li>
               }
               else
               {
                     @Html.Hidden("isAuth",true)
                 
                     <li class="userli user">
                         <label id="lbfullname" for="yourfullname">@Fcom.VNInsurance.Web.LangResource.Layout.lblFullname</label>
                         <input type="text"  class="form-control" style="width:170px" name="yourfullname" id="yourfullname" placeholder="@Fcom.VNInsurance.Web.LangResource.Layout.lblEnterFullname" value="@Userinfo.Fullname"/>
                     </li>
                      <li class="userli user">
                         <label for="youremail">@Fcom.VNInsurance.Web.LangResource.Layout.lblEmail</label>
                         <input type="text"  style="width:170px" class="form-control" name="youremail" id="youremail" placeholder="@Fcom.VNInsurance.Web.LangResource.Layout.lblEnterYourEmail" value="@Userinfo.Email"/>
                        
                     </li>
                      <li class="userli user">
                         <label for="yourphone">@Fcom.VNInsurance.Web.LangResource.Layout.lblYourPhone</label>
                         <input type="text"  style="width:170px" class="form-control" name="yourphone" id="yourphone" placeholder="@Fcom.VNInsurance.Web.LangResource.Layout.lblEnterYourPhone" value="@Userinfo.Phone"/>
                     </li>
                      if(Userinfo.GroupID==1)
                      {
                       <li class="userli user userpersonal">
                    <label for="Model">@Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblGender</label>
                    <label style="font-weight:normal" class="nonleft"><input  type="radio" name="gender" value="true" @(Userinfo.Gender ==true ? "checked": "")>@Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblBoy</label> <label class="nonleft" style="font-weight:normal"><input type="radio" name="gender" value="" @(Userinfo.Gender==false ? "checked": "") readonly>@Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblGirl</label>
                           <div style="clear:both"></div>
                </li>
                      <li class="userli user userpersonal">
                    <label for="Model">@Fcom.VNInsurance.Web.LangResource.LifeInsurance.lblBirthday</label>
                    <input type="text" name="dateofBirth" class="form-control" id="dateofBirth"  value="@(Userinfo.DateOfBirth.ToString())" placeholder="dd/mm/yyyy"/>
                           <div style="clear:both"></div>
                </li>
                      }
               }
            </ul>
                
           
            
    </div>
         <div class="accleft">
              
    <div class="accordion" id="accordion2">
            @foreach (var fq in productFAQ)
            { 
                                    <h3><img src="@Url.Content("~/Content/images/arrow_accord.gif")" alt="vnbaohiem"/> @fq.Question</h3>
                <div>

                    @Html.Raw(HttpUtility.HtmlDecode(fq.Answer))
                </div>
            }
    </div>
    </div>
    <div style="clear:both"></div>
</div>
<div id="summary"></div>
<style>
    
    .accleft
    {
        margin-left: 10px;
    }
    .accright
    {
        margin-left:3px;
    }
    .user
    {
        width: 100%;
position: relative;
    }
     ul li.user label.nonleft {
width: 57px;
padding-left: 0px;
padding-right: 10px;
}
     ul li.user label.nonleft2 {
width: 100px;
padding-left: 0px;
padding-right: 10px;
}
     ul li.user label {
margin-left: 15px;
width: 290px;
float: left;
display: block;
margin-top: 8px;
}
    #benefitinfo
    {
        padding-left: 10px;
padding-right: 30px;
padding-top: 10px;
line-height: 25px;
border: 1px solid #ccc;
border-radius: 5px;
margin-left: 8px;
margin-right: 10px;
    }
    .txt_travel
    {
        color: #163da5;
font-size: 14px;
font-weight: bold;
text-decoration: underline;
cursor: pointer;

    }
    .agreedv
    {
        padding-bottom: 55px;
    }
    .header_gid
    {
        background:url(../Content/images/Travel/bg_quote_header.png) repeat-x;
        background-position: bottom;
        
    }
</style>
<div id="benefitinfo">
    <table class="table table-bordered responsive dataTable" >
        <thead><strong>@Fcom.VNInsurance.Web.LangResource.InternationalTravel.lblInfo </strong></thead>
        <tr>
            <td style="width:220px;"  align="center" valign="middle" class="header_gid orange_tc font18 bold" colspan="2" rowspan="2"><strong>@Fcom.VNInsurance.Web.LangResource.InternationalTravel.lblCoverages</strong></td>
            <td align="center" valign="middle" class="header_gid orange_tc font18 bold" colspan="3"><strong>@Fcom.VNInsurance.Web.LangResource.InternationalTravel.lblpackage</strong></td>
         </tr>
        <tr>
            @foreach (var producpacka in packageproduct)
            {
                foreach(var packlang in packagelang)
                    {
                        if(packlang.PackageID==producpacka.PackageID)
                        {
                                 <td style="padding-left:10px; text-align: center;">@packlang.DisplayNamePackage
                                <input type="radio"  name="PackageID" value="@producpacka.ID"  onclick="javascript: CheckSelectPacket(this);">
                                <br />
                                <span style="color:red;">@Fcom.VNInsurance.Web.LangResource.InternationalTravel.lblVND</span>
                                <br />
                               @Fcom.VNInsurance.Web.LangResource.InternationalTravel.lblNumof
                                </td>
                        }
                    }
            }
        </tr>
        <script>
            function ShowHide(id) {
                var id = id;
                var elements = document.getElementsByClassName(id);
                for (var i = 0, length = elements.length; i < length; i++) {
                    if (elements[i].style.display == 'none') {
                        elements[i].style.display = '';
                        event.preventDefault()
                    }
                    else {
                        elements[i].style.display = 'none';
                        event.preventDefault()
                    }

                    
                    
                }
            }
        </script>
        @foreach (var c in bene)
        {
                {
                    foreach (var d in benelang)
                    {
                        if (c == d.BenefitID)
                        {
                       <tr>
                           <td colspan="2" style="padding-left:10px;" id="@d.BenefitID" onclick="javascript:ShowHide(@d.BenefitID)"><span class="txt_travel"> @d.DisplayName</span></td>
                            @foreach(var bec in packagebenefit)
                            {
                                if(bec.BenefitID==d.BenefitID)
                                {
                                <td style="padding-left:5px;text-align: center;">
                                   
                                   @Fcom.VNInsurance.Web.LangResource.InternationalTravel.lblTo @bec.Liability
                                </td>
                                }


                            }
                        </tr>
                        }
                        if (d.Benefit.ParentID == c)
                        {
              
                          <tr class="@d.Benefit.ParentID" style="display:none;">
                           <td colspan="2" style="padding-left:10px;">@d.DisplayName</td>
                  
                           <td></td>
                           <td></td>
                           <td></td>
                        </tr>
                        }
                    }
                }

        }
       
    </table>
    <div class="agreedv">
                <input type="checkbox" name="AgreeTerm" checked /> @Fcom.VNInsurance.Web.LangResource.ContactLayout.lblAgree <a href="@Url.Action("Term", "Home")" target="_blank">@Fcom.VNInsurance.Web.LangResource.ContactLayout.lblOurTermagree</a>
                 <input type="submit" id="btnsubmitf" class="btnbaophi@(Request.Cookies["_culture"]["lang"])" style="" value="Báo phí"/>
                    </div>
    <div style="clear:both"></div>
</div>

 </form>
<div style="padding-left:30px;padding-right:30px;padding-top:10px;line-height:25px;" class="ctcontainer">  @Html.Raw(HttpUtility.HtmlDecode(Model.DisplayIntro))</div>
<div class="container">
    <p id="vnquestion-fb"> @Fcom.VNInsurance.Web.LangResource.ContactLayout.lblIfhaveQuestion</p>
   
</div>
<div class="container">
    <div class="accright">   
   
          <div id="disqus_thread"></div>
    <script type="text/javascript">
        /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
        var disqus_shortname = 'vnbaohiemcom'; // required: replace example with your forum shortname

        /* * * DON'T EDIT BELOW THIS LINE * * */
        (function () {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
    </script>
  
    
        </div>

 <div class="accleft">
              
     <iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2FVnbaohiem&amp;height=258&amp;colorscheme=light&amp;show_faces=true&amp;header=false&amp;stream=false&amp;show_border=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100%; height:260px;" allowTransparency="true"></iframe>   
         <div class="container">
                              <!-- AddThis Button BEGIN -->
        <div class="addthis_toolbox addthis_default_style ">
        <a class="addthis_button_preferred_1"></a>
        <a class="addthis_button_preferred_2"></a>
        <a class="addthis_button_preferred_3"></a>
        <a class="addthis_button_preferred_4"></a>
        <a class="addthis_button_compact"></a>
        <a class="addthis_counter addthis_bubble_style"></a>
        </div>
     
        <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-52116863612dd7b2"></script>
        <!-- AddThis Button END -->
         </div>
    </div>
    
<div style="clear:both"></div>
    </div>
<script>
    $(document).ready(function () {

        var AppUrl = $("#AppUrl").html();
        //frmcollect

        var validator = $("#frmcollect").bind("invalid-form.validate", function () {
            //$("#summary").html("Your form contains " + validator.numberOfInvalids() + " errors, see details below.");
        }).validate({

            errorElement: "em",
            errorContainer: $("#warning, #summary"),
            errorPlacement: function (error, element) {
                element.parent().children("em").remove();
                error.appendTo(element.parent());
            },
            success: function (label) {
                label.addClass("success");
                label.removeClass("error");
            }


        });
        $("#yourfullname").rules("add", "required");
        $("#youremail").rules("add", "required");

        $("#youremail").rules("add", "email");
        $("#yourphone").rules("add", "required");
        $("#yourphone").rules("add", "number");

        //

        //
        $(".rdtrue").change(function () {
            var detaildv = $(this).attr("dl");
            $(".dl" + detaildv).removeClass("hiddenBenefit");

            return false;
        });
        $(".rdfalse").change(function () {
            var detaildv = $(this).attr("dl");
            $(".dl" + detaildv).addClass("hiddenBenefit");
            return false;
        });
        $("#Manufacturer").change(function () {
            var autoCatID = $(this).val();
            $("#Model").prop("disabled", "disabled");
            $.ajax({
                type: "post",
                url: AppUrl + "/Moto/ajLoadMotobike",
                data: { CatID: autoCatID },
                datatype: "json",
                success: function (bikes) {

                    var htmlcode = "";
                    $(bikes).each(function (index, item) {
                        htmlcode += "<option value='" + item.ID + "'>" + item.Name + "</option>";
                    });
                    $("#Model").html(htmlcode);
                    $("#Model").prop("disabled", false);
                }
            });
            return false;
        });
        //accountinfodv
        $("#optionsRadios2").change(function () {
            $(".userli").removeClass("hiddenBenefit");
            $("#yourfullname").rules("add", "required");
            $("#youremail").rules("add", "required");
            $("#youremail").rules("add", "email");
            $("#yourphone").rules("add", "required");
            //emailexist

            //youremail
            return false;
        });
        $("#optionsRadios1").change(function () { $("em[for='youremail']").removeClass("error");
            $(".userli").addClass("hiddenBenefit");
            $("#yourfullname").rules("remove", "required");
            $("#youremail").rules("remove", "required");
            $("#yourphone").rules("remove", "required");

            return false;
        });
        $("#accountbussiness").change(function () {
            $(".userpersonal").addClass("hiddenBenefit");
            $("#lbfullname").text("@Html.Raw(Fcom.VNInsurance.Web.LangResource.ContactLayout.lblcorpname)");
            $("#yourphone").attr("placeholder", "@Html.Raw(Fcom.VNInsurance.Web.LangResource.ContactLayout.lblentercorpphone)");
            $("#yourfullname").attr("placeholder", "@Html.Raw(Fcom.VNInsurance.Web.LangResource.ContactLayout.lblentercorpname)");
        });
        //accountpesional
        $("#accountpesional").change(function () {
            $(".userpersonal").removeClass("hiddenBenefit");
            $("#lbfullname").text("Họ và tên");
            $("#yourphone").attr("placeholder", "@Fcom.VNInsurance.Web.LangResource.Layout.lblEnterYourPhone");
            $("#yourfullname").attr("placeholder", "@Html.Raw(Fcom.VNInsurance.Web.LangResource.Layout.lblEnterFullname)");
        });
        //
        $("#btnsubmitf").click(function () {
            var gender_check = $('input:radio[name=PackageID]:checked').val();
            if (!gender_check) {
                alert("Please select your package.");
                return false;
            }
            else {
              
                $("#youremail").blur();
                if (!$("em[for='youremail']").hasClass("error")) {
                    $("#frmcollect").submit()
                }
                return false;
            }

        });

        $("#youremail").blur(function () {

            var exists = false;
            if ($("#optionsRadios2").is(":checked")) {
                $.ajax({
                    type: "post",
                    url: "@Url.Action("CheckEmailExists", "Account")",
                    datatype: "json",
                    data: { youremail: $("#youremail").val() },
                    success: function (rvdata) {
                        if (rvdata.success) {

                            $("#youremail").addClass("error");
                            $("em[for='youremail']").html("Email is exists, please choose an other").removeClass("success").addClass("error");
                        }
                        else {
                            $("#youremail").removeClass("error");

                        }
                    }
                });
            }

            return false;
        });
    });
</script>
